<?php

namespace common\models;

use Yii;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;

/**
 * This is the model class for table "project".
 * 研究项目实体类
 *
 * @author Bran <lin.yang@ht-med.com>
 * @copyright (c) 2015, HT-MED
 * @package common.models
 * @since version 1.0
 *
 * @property integer $id
 * @property string $seq
 * @property string $protocol_id
 * @property string $abbreviation
 * @property string $project_name
 * @property string $code
 * @property string $status
 * @property string $pi
 * @property string $summary
 * @property string $description
 * @property string $sponsor
 * @property integer $phase
 * @property integer $type
 * @property string $study_start_date
 * @property string $study_completion_date
 * @property integer $masking
 * @property integer $random
 * @property integer $sample
 * @property integer $created_at
 * @property integer $updated_at
 */
class Project extends ActiveRecord {
	/**
	 * @inheritdoc
	 */
	public static function tableName() {
		return 'project';
	}
    
    public function attributeLabels()
    {
        return [
            'id' => '222',
            'protocol_id' => Yii::t('project', 'protocol_id'),
            'abbreviation' => Yii::t('project', 'abbreviation'),
            'project_name' => Yii::t('project', 'project_name'),
            'code' => Yii::t('project', 'code'),
            'status' => Yii::t('project', 'status'),
            'pi' => Yii::t('project', 'pi'),
            'summary' => Yii::t('project', 'summary'),
            'description' => Yii::t('project', 'description'),
            'sponsor' => Yii::t('project', 'sponsor'),
            'phase' => Yii::t('project', 'phase'),
            'type' => '试验对象种类',
            'study_start_date' => Yii::t('project', 'study_start_date'),
            'study_completion_date' => Yii::t('project', 'study_completion_date'),
            'masking' => Yii::t('project', 'masking'),
            'random' => Yii::t('project', 'random'),
            'sample' => Yii::t('project', 'sample'),
            'created_at' => Yii::t('project', 'created_at'),
            'updated_at' => Yii::t('project', 'updated_at'),
            'pstyle' => Yii::t('project', 'pstyle'),
            'record' => '备案号',
            'research_major' => Yii::t('project', 'research_major'),
            'person' => Yii::t('project', 'person'),
            'manager' => Yii::t('project', 'manager'),
            'creator' => '创建人',
            'creator_name' => '创建人',
            'is_inside' => '项目类型',
            'is_test' => '是否创建测试环境',
        ];
    }

	public function fields(){
		return [
			'id' => function($data){
		        return 1;
            },
			'protocol_id',
			'abbreviation',
			'project_name',
			'code',
			'pi',
			'summary',
			'description',
			'sponsor',
			'type'
		];
	}

}
